home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / db / esm-3.1 / esm-3 / usr / local / sm / src / serverlib / analyze / analyzeRootEntry.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-05  |  3.0 KB  |  116 lines

  1. /*
  2.  *   $RCSfile: analyzeRootEntry.c,v $  
  3.  *   $Revision: 1.1.1.1 $  
  4.  *   $Date: 1996/05/04 21:55:33 $      
  5.  */ 
  6. /**********************************************************************
  7. * EXODUS Database Toolkit Software
  8. * Copyright (c) 1991 Computer Sciences Department, University of
  9. *                    Wisconsin -- Madison
  10. * All Rights Reserved.
  11. *
  12. * Permission to use, copy, modify and distribute this software and its
  13. * documentation is hereby granted, provided that both the copyright
  14. * notice and this permission notice appear in all copies of the
  15. * software, derivative works or modified versions, and any portions
  16. * thereof, and that both notices appear in supporting documentation.
  17. *
  18. * THE COMPUTER SCIENCES DEPARTMENT OF THE UNIVERSITY OF WISCONSIN --
  19. * MADISON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION.  
  20. * THE DEPARTMENT DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES
  21. * WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  22. *
  23. * The EXODUS Project Group requests users of this software to return 
  24. * any improvements or extensions that they make to:
  25. *
  26. *   EXODUS Project Group 
  27. *     c/o David J. DeWitt and Michael J. Carey
  28. *   Computer Sciences Department
  29. *   University of Wisconsin -- Madison
  30. *   Madison, WI 53706
  31. *
  32. *     or exodus@cs.wisc.edu
  33. *
  34. * In addition, the EXODUS Project Group requests that users grant the 
  35. * Computer Sciences Department rights to redistribute these changes.
  36. **********************************************************************/
  37.  
  38.  
  39. #include "sysdefs.h"
  40. #include "ess.h"
  41. #include "checking.h"
  42. #include "trace.h"
  43. #include "error.h"
  44. #include "list.h"
  45. #include "pool.h"
  46. #include "tid.h"
  47. #include "io.h"
  48. #include "page.h"
  49. #include "lock.h"
  50. #include "object.h"
  51. #include "msgdefs.h"
  52. #include "thread.h"
  53. #include "semaphore.h"
  54. #include "latch.h"
  55. #include "link.h"
  56. #include "lsn.h"
  57. #include "bf.h"
  58. #include "volume.h"
  59. #include "openlog.h"
  60. #include "trans.h"
  61. #include "logrecs.h"
  62. #include "logaction.h"
  63. #include "log.h"
  64. #include "log_extfuncs.h"
  65. #include "recover_intfuncs.h"
  66. #include "trans_extfuncs.h"
  67. #include "analyze_extfuncs.h"
  68. #include "thread_globals.h"
  69.  
  70.  
  71.  void
  72. analyzeRootEntry (
  73.  
  74.     LOGRECORDHDR        *record 
  75. )
  76. {
  77.  
  78.     PID                    pid;
  79.     DIRTYPAGEINFO        *dirtyInfo;
  80.  
  81.     TRACE(TR_IO|TR_RECOVER, TR_LEVEL_1);
  82.  
  83.     /*
  84.      *    calculate the root entry page
  85.      */
  86.     pid.volid = record->actionPid.volid;
  87.     pid.page = ROOTPAGEADDR;
  88.     TRPRINT(TR_RECOVER, TR_LEVEL_2, ("page:%d volid:%d", pid.page, pid.volid));
  89.  
  90.     /*
  91.      *    Make sure this matches the action pid
  92.      */
  93.     SM_ASSERT(LEVEL_3, PIDEQ(pid, record->actionPid));
  94.  
  95.     /*
  96.      *    check to see if the page is in the dirty list
  97.      */
  98.     if ((dirtyInfo = searchDirtyPageTable( &pid )) == NULL)    {
  99.  
  100.         /*
  101.          *    create a new entry
  102.          */
  103.         if ((dirtyInfo = insertDirtyPageTable( &pid )) == NULL)    {
  104.  
  105.             SM_ERROR(TYPE_FATAL, esmINTERNAL);
  106.         }
  107.  
  108.         /*
  109.          *    update the information
  110.          */
  111.         dirtyInfo->lsn = record->recordLSN;
  112.         dirtyInfo->lrc = record->actionLRC;
  113.         TRPRINT(TR_RECOVER, TR_LEVEL_2, ("lsn:%d, lrc%d", dirtyInfo->lsn.offset, dirtyInfo->lrc.count));
  114.     }
  115. }
  116.